﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Comissoes.Models.LojasModel>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Index</title>
    <!-- CSS -->
    <%= ViewData["scripts"] %>
</head>
<body>
    <div class="cabecalho ui-state-highlight">
        <span class="icolst" />
        <span class="txt">
            <%= Html.Encode("Edição de Lojas") %>
        </span>
    </div>    
    <form action="javascript:saveDialog('Lojas', $('#COD_LOJA').val())">
        <fieldset class="container transparent">
            <label class="input160">
                <button class="diskcommand" type="submit"">Salvar</button>
                <% if (Model.loja.COD_LOJA == 0)
                   { %>                    
                    <button class="closecommand" type="button" onclick="loadOption('/Lojas/Index', true);">Cancelar</button>
                <% }
                   else
                   { %>
                    <button class="closecommand" type="button" onclick="loadOption('/Lojas/Details/<%= Html.Encode(Model.loja.COD_LOJA) %>', true);">Cancelar</button>
                <% } %>
            </label>
        </fieldset>
        <fieldset class="container field520 border ui-widget-content ui-corner-all">
            <%= Html.Label("COD_LOJA", "for80", "Código:") %>
            <% if (Model.loja.COD_LOJA == 0)
               { %>
            <%= Html.LabelInput(Html.TextBox("COD_LOJA"), "input80 right integer setfocus") %>
            <% } %>
            <% else
               { %>
            <%= Html.LabelInput(Html.TextBox("COD_LOJA", Model.loja.COD_LOJA, new { @readonly = "readonly" }), "input80 right") %>
            <% } %>
            
            <%= Html.Label("LIMITE_CLI", "for60 right", "Regime:") %>
            <%= Html.LabelInput(Html.DropDownList("ID_RGTR", ViewData["IDRGTR"] as SelectList, "[selecione]"), "select180") %>

            <%= Html.Label("ATIVO_LOJA", "for20 right", "Ativa") %>
            <label class="space"></label>
            <%= Html.LabelInput(Html.CheckBox("ATIVO_LOJA", Model.loja.ATIVO_LOJA == "A" || Model.loja.ATIVO_LOJA == null), "Check") %>

            <%= Html.Label("NOME_LOJA", "for80 clear", "Fantasia:") %>
            <%= Html.LabelInput(Html.TextBox("NOME_LOJA", Model.loja.NOME_LOJA), "input400") %>

            <% Html.RenderAction("Edit", "Pessoas", Model.loja.PESSOAS); %>
        </fieldset>
    </form>
</body>
</html>